<template>
	<view>
		<web-view v-if="url" :update-title="true" :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		name: "WebView",
		onLoad(opt) {
			this.$log(this.$options.name, opt);
			
			// 标题参数
			if (opt.title) {
				uni.setNavigationBarTitle({
					title: opt.title
				});
			}
			
			// 网站链接
			if (opt.url) {
				this.url = decodeURIComponent(opt.url);
			}
		},
		data() {
			return {
				url: null
			};
		}
	}
</script>

<style>
</style>
